<form name="frmDanhSachSinhVien" id="frmDanhSachSinhVien" method="post">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
    <?php
	$_rowHeader = "DANH SÁCH SINH VIÊN LỚP " . $maSoLop;
	include "views/RowHeader.php";
	?>
    <tr>
        <td colspan="3">
            <table width="100%" border="1" cellspacing="0" cellpadding="1" class="table_content">
                <tr>
                    <th width="7%">STT</th>
                    <th width="10%">MSSV</th>
                    <th>Họ tên sinh viên</th>
                    <th width="7%">Điểm SV</th>
                    <th width="7%">Điểm CVHT</th>
                    <th width="7%">Điểm HĐK</th>
                    <th width="15%">Xếp loại</th>
                    <th width="15%">&nbsp;</th>
                </tr>
                <?php
				
				$db = new HocKy();
				
				if (count($danhSachSinhVien)) {
					$i = 1;
					foreach($danhSachSinhVien as $sv) {
						$db->setQuery('SELECT TONG_DIEM_SV, TONG_DIEM_CVHT, TONG_DIEM_HDK, XL_TEN '
									 . ' FROM CO_DIEM_REN_LUYEN, XEP_LOAI_DIEM_REN_LUYEN '
									 . ' WHERE SV_MA_SO = ' . $sv['SV_MA_SO']
									 . ' AND HK_MA_SO = \'' . $db->getMaHocKy() . '\''
									 . ' AND (TONG_DIEM_HDK BETWEEN XL_DIEM_SAN AND XL_DIEM_TRAN)');
						$diem = mysql_fetch_assoc($db->fetchAll());
				?>
                <tr>
                	<th><?php echo $i++; ?></th>
                    <td align="center"><?php echo $sv['SV_MA_SO'] ?></td>
                    <td><?php echo $sv['SV_HO_TEN'] ?></td>
                    <td align="center"><?php echo (isset($diem['TONG_DIEM_SV']) ? $diem['TONG_DIEM_SV'] : '-') ?></td>
                    <td align="center"><?php echo (isset($diem['TONG_DIEM_CVHT']) ? $diem['TONG_DIEM_CVHT'] : '-') ?></td>
                    <td align="center"><?php echo (isset($diem['TONG_DIEM_HDK']) ? $diem['TONG_DIEM_HDK'] : '-') ?></td>
                    <td align="center"><?php echo (isset($diem['XL_TEN']) ? $diem['XL_TEN'] : '-') ?></td>
                    <td align="center">
                    	<input type="button" id="<?php echo $sv['SV_MA_SO']; ?>" class="button_1"
                        	value="Chấm điểm" onclick="chamDiemSinhVien(this.id);"
                            />
                    </td>
                </tr>
                <?php
					}
				} else {
					echo '<tr><td colspan="8" align="center">Lớp này không sinh viên nào!</td></tr>';
				}
				?>
            </table>
        </td>
    </tr>
    <tr><td colspan="3">&nbsp;</td></tr>
</table>
</form>